package main

import (
	"log"
	"os"

	"gitee.com/youkelike/ziam/xlog"
)

func main() {
	xlog.Info("std log")

	fd, err := os.OpenFile("./test.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
	if err != nil {
		log.Fatalln("create file test.log failed")
	}
	defer fd.Close()
	l := xlog.New(xlog.WithLevel(xlog.DebugLevel), xlog.WithOutput(fd), xlog.WithFormatter(&xlog.JsonFormatter{}))
	l.Debug("log with json formatter")
}
